<!--  -->
<template>
  <div class="orderhoet">
    <div v-if="commList.length > 0">
      <div v-for="(item,i) in commList" class="listWarp" :key='i'>
        <div class="goods" >
          <div class="titleID">订单号：{{item.order && item.order.order_sn}}</div>
          <div class="product flex">
            <div class="img">
              <img :src="item.thumb">
            </div>
            <div class="warp">
              <ul class="inner  flex-j-sb">
                <li class="name ell">{{item.title|escapeTitle}}</li>
                <li class="commodity_price name">
                  <small>{{$i18n.t('money')}}</small>
                  {{item.price}}
                </li>
              </ul>
              <ul class="price flex-a-c flex-j-sb">
                <li class="option" v-if="item.goods_option_title">规格: {{item.goods_option_title}}</li>
                <li class="option total"> ×{{item.total}}</li>
              </ul>
              <div class="wrap-eval flex">
                <div class="evaluate" @click="toComment(item.id,item.order)">去评价</div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <van-empty description="暂无数据"  v-else/>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';

export default {
name:'',
props:{
  selected:{
    type:Number,
    default:0
  },
  commList:{
    type:Array,
    default:() => {
      return []
    }
  }
},
//import引入的组件需要注入到对象中才能使用
components: {},
data() {
return {
  toi: this.fun.getKeyByI(),
};
},
//监听属性 类似于data概念
computed: {},
//监控data中的数据变化
watch: {},
//方法集合
methods: {
  toComment(order_id, good) {
    this.$router.push({ name: "evaluate", params: { order_id: good.id, id: order_id }, query: { i: this.toi } });
  },
},
//生命周期 - 创建完成（可以访问当前this实例）
created() {

},
//生命周期 - 挂载完成（可以访问DOM元素）
mounted() {
  console.log(this.commList);
},
beforeCreate() {}, //生命周期 - 创建之前
beforeMount() {}, //生命周期 - 挂载之前
beforeUpdate() {}, //生命周期 - 更新之前
updated() {}, //生命周期 - 更新之后
beforeDestroy() {}, //生命周期 - 销毁之前
destroyed() {}, //生命周期 - 销毁完成
activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
}
</script>
<style lang="scss" scoped>
/* @import url(); 引入公共css类 */
.pl {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ell {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  /* 定义显示的行数 */
  overflow: hidden;
}
.orderhoet-main {
  margin:0.5rem 0.75rem 0 0.75rem;
}
//新的样式
.wrap-eval {
  width:100%;
  justify-content: flex-end;
  padding:0.75rem 0 0 0;
  .evaluate {
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.0625rem;
    color: #FFFFFF;
    padding:0.25rem 0.75rem;
    border-radius: 1.125rem;
    
    background-color: var(--themeBaseColor);
  }
}
.orderhoet {
  margin-bottom: 0;
  .listWarp {
    margin:0 0 0.5rem 0;
    border-radius: 0.5rem;
  }
  .titleID {
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.0625rem;
    color: #999999;
    text-align: left;
    padding:0 0 0.5rem 0;
    word-wrap: break-word;
    white-space: pre-wrap;
  }
}
.goods {
  background-color: #fff;
  padding:0.75rem;
  border-radius: 0.5rem;
  margin:0 0 0.5rem 0;
  .img {
    width: 4.375rem;
    display: inline-block;
    margin:0 0.25rem 0 0;

    img {
      width: 4.375rem;
      height: 4.375rem;
      border-radius: 0.25rem;
    }
  }

  .warp {
    // width: 68%;
    flex-direction: column;
    flex:2;
    min-height: 4.375rem;
    display: flex;

    .inner {
      width: 100%;
      box-sizing: border-box;
      text-align: left;
      padding: 0 0 0.5rem 0;
      .name {
        text-align: left;
        color: #333;
        font-size: 0.8125rem;
        line-height: 1.1875rem;
      }
      .commodity_price {
        min-width: 38%;
        font-weight: bold;
        text-align: right;
      }
    }

    .price {
      width: 100%;
      align-items: center;
      text-align: right;
      box-sizing: border-box;
      li {
        font-size: 0.75rem;
        font-weight: 400;
        line-height: 1.0625rem;
        color: #999999;
      }
      p {
        margin-top: 0;
      }

      .yijp {
        background: #888;
        padding: 0 0.3125rem;
        color: #fff;
      }
    }
  }

  .option {
    color: #999999;
    font-size: 0.75rem;
    flex: 1;
    text-align: left;
  }
  .total {
    text-align: right;
  }

  .option2 {
    color: #e84e40;
    font-size: 0.875rem;
    flex: 1;
    width: 100%;

    font {
      float: left;
    }
  }
}
</style>